import request from "@/utils/request.js";
import Cache from "@/utils/cache.js"
const url = '/salesman'

/**
 * 获取编辑名片信息
 */
export function businessCard(data) {
	return request.get(url + '/salesman/getBusinessCard', data);
}

/**
 * 修改头像
 */
export function editAvatar(data) {
	return request.post(url + `/updateAvatar?avatar=${data.avatar}`);
}

/**
 * 获取手机号验证码
 */
export function editPhoneSendMsm(data) {
	return request.post(url + `/updateContactPhoneSendMsm?contactPhone=${data.contactPhone}`);
}

/**
 * 修改手机号
 */
export function editPhone(data) {
	return request.post(url + '/updateContactPhone', data);
}

/**
 * 修改邮箱
 */
export function editEmail(data) {
	return request.post(url + `/updateEmail?email=${data.email}`);
}

/**
 * 修改二维码
 */
export function editWechatQrCode(data) {
	return request.post(url + `/updateWechatQrCode?wechatQrCode=${data.wechatQrCode}`);
}

/**
 * 修改视频号
 */
export function editWechatVideoChannel(data) {
	return request.post(url + `/updateWechatVideoChannel?wechatVideoChannel=${data.wechatVideoChannel}`);
}

/**
 * 修改微信
 */
export function editWechatNum(data) {
	return request.post(url + `/updateWechatNum?wechatNum=${data.wechatNum}`);
}

/**
 * 修改个人简历
 */
export function editResume(data) {
	return request.post(url + `/updateResumeBody`, data);
}

/**
 * 二维码
 */
export function getMiniCodeTest(data) {
	return request.post(url + `/wechat/getMiniCode`, data);
}

/**
 * 根据id 且不用token获取编辑名片信息
 */
export const noTokenbusinessCard = (id) => {
	return request.get(url + `/open/getBusinessCardByIdNoToken/${id}`)
}
// 添加业务员与权益卡关联
export function addAgentAssociatedWithEquityCard(data) {
	return request.post(url + `/equity_4_cow/addAgentAssociatedWithEquityCard`, data);
}
// 查询业务员与权益卡关联列表
export function queryAgentAssociatedWithEquityCard(data) {
	return request.post(url + `/equity_4_cow/queryAgentAssociatedWithEquityCard`, data);
}

// 查询业务员与权益卡关联统计数据（用户总数、已激活、未激活）
export function queryStatisticalDataWithEquityCard(data) {
	return request.post(url + `/equity_4_cow/queryStatisticalDataWithEquityCard`, data);
}
export const getSalesmanByPhone = (params) => {
	return request.get(url + `/getSalesmanByPhone`, params)
}
export const searchSubList = (params) => {
	return request.get(url + `/manageMa/searchSubList`, params)
}
// 业务员小程序-生成微信公众号二维码
export function genWxMpQrCode(data) {
	return request.post(url + `/wx/qrcode/genWxMpQrCode`, data);
}

/**
 * 查看自己已经推荐的业务员列表
 */
export function recommendedTheSalesman(data) {
	return request.post(url + `/recommendedTheSalesman`, data);
}

/**
 * 业务员小程序 分页查询自己客户的解读记录
 */
export function listConventionInterpretationReport(data) {
	return request.post(url + `/customerCentre/listConventionInterpretationReport`, data);
}